From ac29108586f46e8c4a30871c9c2053b9206271d6 Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Fri, 11 Nov 2011 01:35:50 +0100 Subject: [PATCH] a11y: Change function declaration Returning an int seems way easier than having an int out argument to a void function. Also, it doesn't lead to uninitialized memory, what a concept! --- gtk/a11y/gtktreeviewaccessible.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gtk/a11y/gtktreeviewaccessible.c b/gtk/a11y/gtktreeviewaccessible.c index 846a4a3f2e..83667947c8 100644 --- a/gtk/a11y/gtktreeviewaccessible.c +++ b/gtk/a11y/gtktreeviewaccessible.c @@ -3160,21 +3160,23 @@ cell_destroyed (gpointer data) } } -static void +static int cell_info_get_index (GtkTreeView *tree_view, - GtkTreeViewAccessibleCellInfo *info, - gint *index) + GtkTreeViewAccessibleCellInfo *info) { GtkTreePath *path; gint column_number; + int index; path = gtk_tree_row_reference_get_path (info->cell_row_ref); if (!path) - return; + return -1; column_number = get_column_number (tree_view, info->cell_col_ref, FALSE); - *index = get_index (tree_view, path, column_number); + index = get_index (tree_view, path, column_number); gtk_tree_path_free (path); + + return index; } static void @@ -3234,7 +3236,7 @@ refresh_cell_index (GtkCellAccessible *cell) if (!info) return; - cell_info_get_index (tree_view, info, &index); + index = cell_info_get_index (tree_view, info); cell->index = index; g_hash_table_insert (accessible->cell_info_by_index, &index, info); } -- 2.30.2